package com.aos.erp.schools.remote;

import com.aos.erp.common.bean.PageBean;
import com.aos.erp.common.bean.ResultEntity;
import com.aos.erp.schools.remote.model.MessageTemplateInfo;
import com.aos.erp.schools.remote.model.dto.MessageRecordItemDTO;
import com.aos.erp.schools.remote.model.dto.MessageTemplateDTO;
import com.aos.erp.schools.remote.model.dto.MessageTemplateItemDTO;
import com.aos.erp.schools.remote.model.vo.MRConditionVo;
import com.aos.erp.schools.remote.model.vo.MTConditionVo;
import com.aos.erp.schools.remote.model.vo.PushMessageVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(name = "${erp-message-server}", url = "${erp-message-server-url}")
public interface MessageService {

    /**
     * 分页查询消息模板
     * @param condition
     * @return
     */
    @PostMapping(value = "/service/message/template/listPage")
    PageBean<MessageTemplateItemDTO> queryTemplateForPage(MTConditionVo condition);

    /**
     * 查询所有消息模板
     * @return
     */
    @PostMapping(value = "/service/message/template/listAll")
    List<MessageTemplateInfo> queryAllTemplate(Long driverSchoolId);

    /**
     * 查询消息模板详情
     * @param templateId
     * @return
     */
    @PostMapping(value = "/service/message/template/detail")
    MessageTemplateDTO getMessageTemplateDetail(Long templateId);


    /**
     * 分页查询消息记录
     * @param condition
     * @return
     */
    @PostMapping(value = "/service/message/record/listPage")
    PageBean<MessageRecordItemDTO> queryRecordForPage(MRConditionVo condition);

    /**
     * 删除消息记录
     * @param ids 记录ID：id1,id2,id3
     * @return
     */
    @PostMapping(value = "/service/message/record/delete")
    ResultEntity deleteRecord(String ids);

    /**
     * 推送消息
     * @param params
     * @return
     */
    @PostMapping(value = "/service/message/pushMessage")
    ResultEntity pushMessage(PushMessageVo params);
}
